Release 10.1A: OpenEdge Development:
Progress 4GL Reference
PUT statement
Sends the value of one or more expressions to an output destination other than the terminal.
Syntax
STREAMnameSpecifies the name of a stream. If you do not name a stream, Progress uses the unnamed stream. See the DEFINE STREAM statement reference entry in this book and chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces for more information on streams.
UNFORMATTEDTells Progress to display each expression in the same format produced by the EXPORT statement, but without quotes.
expressionSpecifies a constant, field name, variable name, or expression.
FORMATstringThe format in which you want to display the
expression. If you do not use the FORMAT option, Progress uses the defaults shown in Table 42.
Table 43 shows the default formats for other expressions.
Table 43: Default data type display formats Data type Default display format CHARACTER x(8) CLASS3 >>>>>>9 DATE 99/99/99 DATETIME 99/99/9999 HH:MM:SS.SSS DATETIME-TZ 99/99/9999 HH:MM:SS.SSS+HH:MM DECIMAL ->>,>>9.99 HANDLE2 >>>>>>9 INTEGER ->,>>>,>>9 LOGICAL yes/no MEMPTR1 See the note at the end of the table. RAW1 See the note at the end of the table. RECID >>>>>>9 ROWID1 See the note at the end of the table. WIDGET-HANDLE2 >>>>>>9
- You cannot display a MEMPTR, RAW, or ROWID value directly. However, you can convert it to a character string representation using the STRING function and display the result. A ROWID value converts to a hexadecimal string, “0x
hexdigits,” wherehexdigitsis any number of characters “0" through “9" and “A” through “F”. A MEMPTR or RAW value converts to decimal integer string.- To display a HANDLE or WIDGET-HANDLE, you must first convert it using the INTEGER function and display the result.
- To display a CLASS, you must first convert it using the INTEGER or STRING function and display the result.
ATexpressionSpecifies the column position where you want to place the output value. If that position has already been used on the current line, PUT skips to the next line and puts the
expressionin the specified column.TOexpressionSpecifies the column position where you want to end the output value being output. If that position has already been used on the current line, PUT skips to the next line and puts the
expressionin the specified column.SKIP [ (expression) ]Specifies the number of new lines you want to output. If you do not use the SKIP option, PUT will not start a new line to the output stream. If you use the SKIP parameter, but do not specify
expression(or ifexpressionis 0), Progress starts a new line only if output is not already positioned at the beginning of a new line.SPACE [ (expression) ]Specifies the number of spaces you want to output. Spaces are not placed between items being PUT unless you use the SPACE option.
CONTROLexpressionThe expression specifies a control sequence that you want to send without affecting the current line, page counters, and positions maintained within Progress. Following CONTROL,
Exampleexpressioncan be a character-string expression or a RAW variable. It can include null character constants of the form NULL or NULL(expression), whereexpressionspecifies the number of NULLs to send. See the Notes section for details.This procedure creates a text file that contains the names of each customer. The names are separated from each other by a slash (/). The entire file consists of one long line.
Notes
- In the AT, TO, SKIP, and SPACE options, if
expressionis less than or equal to 0, Progress disregards the option.- The PUT statement never automatically starts a new line. You must use SKIP to explicitly start a new line.
- The PUT statement uses the default display format for the data type of the field or variable you name in the PUT statement. The PUT statement does not overwrite an area that is already used by a previous format when it displays data.
Use the UNFORMATTED option with the PUT statement to override the format-sensitive display.
- You can use the NULL keyword to output null characters (\0) in a control sequence. For example, the following statements write the control sequence ESC A \0 and 20 NULLs to output stream A:
- You can use the PUT statement with an object reference for a class object instance. The PUT statement implicitly calls the ToString( ) method of the class to convert the specified object reference to a character value before it sends the value to the output destination.
See also
DEFINE STREAM statement, DISPLAY statement, EXPORT statement, OUTPUT TO statement, PAGE statement, PUT SCREEN statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |